package algo.math.evaluator.context.operator;

import java.lang.reflect.Type;
import algo.math.evaluator.base.exceptions.InvalidToken;
import algo.math.evaluator.base.exceptions.UnrecognizedToken;
import algo.math.evaluator.context.operator.interfaces.IOperator;
import algo.math.evaluator.value.IValue;

/**
 * Represent an open parenthesis.
 */
public class ParenthesisOpen extends Operator  {
	
	private String _name = OperatorSymbol.OPEN_PARENTHESIS.toString();
	
	private String _value= "(";
	
	private TokenType _type=TokenType.OPERATOR;
	
	private int _level=1;
	
	private int _nbOperands =0;

	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.operator.interfaces.IOperator#getName()
	 */
	public String getName() {
		return _name;
	}
	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.operator.interfaces.IOperator#getLevel()
	 */
	public int getLevel() {
		return _level;
	}
	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.operator.interfaces.IOperator#setLevel(int)
	 */
	public void setLevel(int level) {
		return;
	}
	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.operator.interfaces.IOperator#getNbOperands()
	 */
	@Override
	public int getNbOperands() {
		return _nbOperands;
	}
	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.tokenizer.interfaces.IToken#getType()
	 */
	public TokenType getType() {
		return _type;
	}

	/* (non-Javadoc)
	 * @see algo.math.evaluator.tokenizer.interfaces.IToken#setType(algo.math.evaluator.tokenizer.interfaces.IToken.TokenType)
	 */
	public void setType(TokenType type) {
		return;
	}
	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.tokenizer.interfaces.IToken#setValue(java.lang.String)
	 */
	public void setValue(String value) {
		return;
	}
	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.operator.interfaces.IOperator#getValue()
	 */
	public String getValue() {
		return _value;
	}

	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.IComponentObject#getComponentType()
	 */
	public Type getComponentType() {
			return IOperator.class;
	}

	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.IComponentObject#getComponentId()
	 */
	public String getComponentId() {
			return _value;
	}

	
	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.IComponentObject#getComponentName()
	 */
	public String getComponentName() {
			return _name;
	}
	

	/* (non-Javadoc)
	 * @see algo.math.evaluator.context.operator.interfaces.IOperator#evaluate(algo.math.evaluator.value.IValue[])
	 */
	@Override
	public IValue evaluate(IValue[] operands) throws UnrecognizedToken,
			InvalidToken {
		// TODO Auto-generated method stub
		return null;
	}
}
